//
//  AddCollectionViewCell.m
//  片刻
//
//  Created by lanou3g on 15/6/5.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//



//电台列表cell

#import "AddCollectionViewCell.h"
#import <UIImageView+WebCache.h>

@implementation AddCollectionViewCell
-(void)dealloc
{
    self.image = nil;
    self.namelabel = nil;
    self.uerLabel = nil;
    self.model = nil;
    [super dealloc];
}
-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        _image = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
        [self.contentView addSubview:_image];
        _namelabel = [[UILabel alloc] initWithFrame:CGRectMake(2, 80, 96, 20)];
        [_namelabel setTextColor:[UIColor whiteColor]];
        _namelabel.font = [UIFont systemFontOfSize:13];
        [self.contentView addSubview:_namelabel];
        _uerLabel = [[UILabel alloc] initWithFrame:CGRectMake(1, 100, 96, 20)];
        [_uerLabel setTextColor:[UIColor grayColor]];
        _uerLabel.font = [UIFont systemFontOfSize:13];
        [self.contentView addSubview:_uerLabel];
        
        [_image release];
        [_namelabel release];
        [_uerLabel release];
    }
    return self;
}
-(void)setModel:(RadioModel *)model
{
    if (_model != model) {
        [_model release];
        _model = [model retain];
        [_image sd_setImageWithURL:[NSURL URLWithString:model.coverimg]];
        _namelabel.text = model.title;
//        先获取全部的 作者信息 然后找到uname的键值对
        _uerLabel.text = [NSString stringWithFormat:@"by:%@",model.userinfo[@"uname"]];
    }
    
}
@end
